#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QVector>
#include <QPointF>
#include <QString>
#include <QStringList>
#include <QTimer>
#include "simserver.h"
#include "JQChecksum.h"

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

public slots:
    void socketStateChanged(bool);

private slots:
    void posTimeout();
    void recvData(QString _data);
    void on_open_clicked();
    void on_start_clicked(bool checked);

    void on_angle_valueChanged(int value);

private:
    Ui::Widget *ui;
    SimServer* server;
    int cur;
    volatile double angle;
    QTimer posTime;
    QVector<QPointF> vPos;

    void readPoints(QString posFile);
    void simPos(QPointF pos);
};

#endif // WIDGET_H
